﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;

namespace BLL
{
	/// <summary>
	/// Sys_RoleInfo表业务逻辑层
	/// </summary>
	public partial class Sys_RoleBLL //: BaseBLL
	{
		const string RIGHT_CODE_INSERT = "";    //添加权限编码
		const string RIGHT_CODE_UPDATE = "";    //修改权限编码
		const string RIGHT_CODE_DELETE = "";    //删除权限编码

		const string ERROR_CODE_SELECT = "";    //查询异常编码
		const string ERROR_CODE_INSERT = "";    //添加异常编码
		const string ERROR_CODE_UPDATE = "";    //修改异常编码
		const string ERROR_CODE_DELETE = "";    //删除异常编码

		/// <summary>
		/// 创建BLL对象
		/// </summary>
		/// <param name="user">系统的登录用户</param>
		public Sys_RoleBLL()
		{
		}

		/// <summary>
		/// 根据RoleID字段获取Sys_RoleInfo实体对象
		/// </summary>
		/// <param name="roleID">RoleID</param>
		/// <returns>Sys_RoleInfo实体对象</returns>
		//public static Sys_RoleInfo GetInfoById(string roleID)
		//{
		//    try
		//    {
		//        return Sys_RoleDAL.GetInfoById(roleID);
		//    }
		//    catch (Exception ex)
		//    {
		//        Logger.LogError("Sys_RoleBLL", "GetInfo", AppError.EROR, 0, ex, "获取Sys_RoleInfo信息出错。",
		//                        String.Format("roleID = {0}", roleID));
		//        throw new KDSWSystemException(ERROR_CODE_SELECT, ex);
		//    }
		//}

		/// <summary>
		/// 获取Sys_RoleInfo实体对象列表
		/// </summary>
		public static List<Sys_RoleInfo> GetInfoList()
		{
			return Sys_RoleDAL.GetInfoList();
		}
		/// <summary>
		/// 往Sys_RoleInfo表内添加新记录
		/// </summary>
		/// <param name="Sys_RoleInfo">Sys_RoleInfo实体对象</param>
		/// <returns>添加记录索引值</returns>
		public int Insert(Sys_RoleInfo sysRoleInfo)
		{
			//try
			//{
			int identity = Sys_RoleDAL.Insert(sysRoleInfo);
			return identity;
			//}
			//catch (Exception ex)
			//{
			//    Logger.LogError("Sys_RoleBLL", "Insert", AppError.EROR, 0, ex, "添加Sys_RoleInfo信息出错。", null);
			//    throw new KDSWSystemException(ERROR_CODE_INSERT, ex);
			//}
		}

		/*/// <summary>
		/// 更新Sys_RoleInfo表记录
		/// </summary>
		/// <param name="Sys_RoleInfo">Sys_RoleInfo实体对象</param>
		public void Update(Sys_RoleInfo sysRoleInfo)
		{
			try
			{
				Sys_RoleDAL.Update(sysRoleInfo);
			}
			catch (Exception ex)
			{
				Logger.LogError("Sys_RoleBLL", "Update", AppError.EROR, 0, ex, "更新Sys_RoleInfo信息出错。",
								String.Format("RoleID = {0}", sysRoleInfo.RoleID));
				throw new KDSWSystemException(ERROR_CODE_UPDATE, ex);
			}
		}

		/// <summary>
		/// 根据RoleID字段获取Sys_RoleInfo实体对象
		/// </summary>
		/// <param name="roleID">RoleID</param>
		public void Delete(string roleID)
		{
			try
			{
				Sys_RoleDAL.Delete(roleID);
			}
			catch (Exception ex)
			{
				Logger.LogError("Sys_RoleBLL", "Delete", AppError.EROR, 0, ex, "删除Sys_RoleInfo信息出错。",
								String.Format("roleID = {0}", roleID));
				throw new KDSWSystemException(ERROR_CODE_DELETE, ex);
		*/
	}
}
